<?php

/*
|--------------------------------------------------------------------------
| Routes File
|--------------------------------------------------------------------------
|
| Here is where you will register all of the routes in an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/

Route::get('/', function () {

    $dd = encrypt(123456);
    dd($dd);
    return view('welcome');
});

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| This route group applies the "web" middleware group to every route
| it contains. The "web" middleware group is defined in your HTTP
| kernel and includes session state, CSRF protection, and more.
|
*/

Route::group(['middleware' => ['web']], function () {
    //


    Route::get('/test',function (){

        session(['uuu'=>'sasas']);
        dd($_SESSION);
    });

});



// 后胎路由配置
Route::group(['prefix'=>'Admin','namespace'=>'Admin','middleware'=>'web'],function(){

    Route::any('login','LoginController@index');
    Route::get('code','LoginController@code');

    // 登陸后
    Route::group(['middleware'=>['web','admin.login']],function(){
        Route::get('','IndexController@index');
        Route::get('index','IndexController@index');
        Route::get('info','IndexController@info');
        Route::get('quit','LoginController@quit');
        Route::any('passUpdate','LoginController@passUpdate');
        Route::get('password','LoginController@password');

       // 分类模块
        Route::resource('category','CategoryController');

    }
    );
});


?>